/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Tools;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import oracle.jdbc.OracleDriver;

/**
 *
 * @author Fave
 */
public class KoneksiDatabase {
    private static String jdbcURL = "jdbc:mysql://localhost:3306/sms";
    private static String user = "root";
    private static String password = "root";

    private static Connection connection;

    public static Connection KoneksiDataBase() throws SQLException {

         try {
            Class.forName("org.gjt.mm.mysql.Driver");
            connection = (Connection) DriverManager.getConnection(jdbcURL, user, password);
            System.out.println("koneksi berhasil");
        } catch (Exception ex) {
            System.out.println("message: " + ex.getMessage());
        }
        return connection;
    }
}


